<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->charset(); ?>
    <title><?php echo $this->Config->site['title'] ?> - <?php echo $this->Config->site['description'] ?></title>
 	<?php echo $this->css(array('style', 'selectbox', 'panel')) ?>
 	<?php echo $this->script(array('jquery', 'block', 'mouse', 'selectbox', 'panel', 'functions')) ?>
    
 	<script type="text/javascript">
 		var base = '<?php echo Mapper::base() ?>';
 		var image = base + '/app/themes/default/images/ajax-loader.gif';
		var block_css = {'padding': '5px','-moz-border-radius': '0 0 5px 5px','-webkit-border-radius': '0 0 5px 5px','border-radius': '0 0 5px 5px','font-size': '14px','border-top': 0,'top': 0,'border': '3px solid #CCCCCC'}
		var block_config = {css: block_css,message: '<img src="'+image+'"><br />Por favor, aguarde...'};
 	</script>
</head>

<body>
	<div id="header-top"></div>
	<div id="content-all">
		<div id="header">
	    </div>
		<div id="content-left">
	    	<h2 class="title">Painel de Controle</h2>
	   		<div class="box">
            	<?php if (!$this->Auth->is_logged()): ?>
                    <form action="" method="post" id="panel_of_control">
                        <label for="username">Usu&aacute;rio</label>
                        <input type="text" maxlength="10" id="username" name="username" class="input_text"  />
                        <label for="password">Senha</label>
                        <input type="password" maxlength="10" id="password" name="password" class="input_text"  />
                        <input type="hidden" name="action" value="panel_of_control" />
                        <input type="submit" class="input_submit" value="Logar" />
                    </form>
                    <div style="margin: 5px; margin-top: 0;">
                        <p style="margin-bottom: 2px;">Esqueceu sua senha? <?php echo $this->link('clique aqui!', '/forgot', array('class' => 'ajax')); ?></p>
                        <p>Ainda n&atilde;o &eacute; cadastrado? <?php echo $this->link('clique aqui!', '/register', array('class' => 'ajax')); ?></p>
                    </div>
            	<?php else: ?>
                	<ul>
                    	<li><?php echo $this->link('Minha conta', '/account', array('class' => 'first')) ?></li>
                    	<li><?php echo $this->link('Meus personagens', '/character') ?></li>
                        <li><?php echo $this->link('Suporte', '') ?></li>
                        <li><?php echo $this->link('Deslogar', '/logout') ?></li>
                    </ul>
                <?php endif ?>
	        </div>
			<h2 class="title">Menu Principal</h2>
	   		<div class="box">
	        	<ul>
	            	<li><?php echo $this->link('Principal', '/', array('class' => 'first')) ?></li>
	                <li><?php echo $this->link('Registrar-se', '/register') ?></li>
	                <li><?php echo $this->link('Downloads', '/downloads') ?></li>
	                <li><?php echo $this->link('Rankings', '/rankings') ?></li>
	                <li><?php echo $this->link('Informa&ccedil;&otilde;es', '/') ?></li>
	                <li><a href="#">Castle Siege</a></li>
	                <li><a href="#">F&oacute;rum</a></li>
	            </ul>
	        </div>
			<h2 class="title">Equipe</h2>
	   		<div class="box">
				<ul class="clear">
					<?php foreach ($this->Character->team() as $team): ?>
						<li><?php echo $team['name'] ?> - <?php echo convert_status($team['status']) ?></li>
					<?php endforeach ?>
				</ul>
	        </div>
	    </div>
	    <div id="content-middle">
	      	<?php echo $this->content ?>
	  	</div>
		<div id="content-right">
			<h2 class="title">Servidores</h2>
	   		<div class="box">
            <div style="padding-top: 0;">
                <?php foreach ($this->Config->progress as $server): ?>
                    <?php $porcent = Convert::porcent($this->component('Count')->onlines_by_server($server['server']), $server['max']) ?>
                    <div class="server-list">
                        <p class="name"><?php echo $server['name'] ?> - <?php echo $this->component('Count')->onlines_by_server($server['server']) ?> / <?php echo $server['max'] ?></p>
                        <div>
                            <div class="show_bar"><!-- --></div>
                            <div style="width:186px;margin-bottom: 5px;" class="show_bg_bar">
                                <?php if ($porcent <= 97): ?>
                                    <span style="width:<?php echo $porcent ?>%" class="show_bg_blue">&nbsp;<?php echo $porcent ?>%&nbsp;</span>
                                <?php else : ?>
                                    <span style="width:<?php echo $porcent ?>%" class="show_bg_red">&nbsp;<?php echo $porcent ?>%&nbsp;</span>
                                <?php endif; ?>
                            </div>
                            <div class="show_bar"><!-- --></div>
                        </div>
                    </div>
                    <div style="clear: both;"></div>
                <?php endforeach ?>
                <div class="total-online">
                    <p>Total Online: <span class="text"><?php echo $this->component('Count')->onlines() ?></span></p>
                </div>
            </div>
	        </div>
	    	<h2 class="title">Castle Siege</h2>
	    	<div class="box" style="padding: 5px; padding-top: 0;">
	    		<?php $castle = $this->Guild->castle_siege() ?>
	    		<?php if (empty($castle)): ?>
	    			<div class="info"><div class="message">N&atilde;o h&aacute; registros no castle siege</div></div>
	    		<?php else: ?>
	    			<div id="castle_siege">
	    				<div class="mark">
	    					<?php echo $this->image('/mithos/flang.php?mark=' . $castle['mark'] . '&size=60') ?>
	    				</div>
	    				<div class="detail">
	    					<ul>
	    						<li>Guild: <span class="white"><?php echo $castle['guild'] ?></span></li>
	    						<li>Master: <span class="white"><?php echo $castle['master'] ?></span></li>
	    						<li>G. Master: <span class="white"><?php echo $castle['master'] ?></span></li>
	    					</ul>
	    				</div>
	    				<div class="clear"></div>
	    				<div class="info" style="margin-top: 3px; text-align: center;">Pr&oacute;ximo Confronto	 <br /><span class="white"><?php echo $castle['siege_end'] ?></span></div>
	    			</div>
	    		<?php endif ?>
	    	</div>
	        <h2 class="title">Estat&iacute;sticas</h2>
	   		<div class="box">
	        	<ul class="clear">
	            	<li class="first">Total de contas: <span class="white"><?php echo Convert::number($this->component('Count')->accounts()) ?></span></li>
	            	<li>Total de personagens: <span class="white"><?php echo Convert::number($this->component('Count')->characters()) ?></span></li>
	                <li>Total de guilds: <span class="white"><?php echo Convert::number($this->component('Count')->guilds()) ?></span></li>
					<li>Personagens banidos: <span class="white"><?php echo Convert::number($this->component('Count')->banned_characters()) ?></span></li>
	                <li>Conta banidas: <span class="white"><?php echo Convert::number($this->component('Count')->banned_accounts()) ?></span></li>                
	            </ul>
	        </div>
	        <h2 class="title">Informa&ccedil;&otilde;es</h2>
	   		<div class="box">
	        	<ul class="clear">
	            	<li class="first">Nome: <span class="white"><?php echo $this->Config->server['name'] ?></span></li>
	            	<li>Vers&atilde;o: <span class="white"><?php echo $this->Config->server['version'] ?></span></li>
	            	<li>Experi&ecirc;ncia: <span class="white"><?php echo $this->Config->server['experience']?></span></li>
	                <li>Drop: <span class="white"><?php echo $this->Config->server['drop'] ?></span></li>
	            </ul>
	        </div>
	    </div>
	</div>
	<div id="footer">
	    &copy; <?php echo date('Y') ?> - Todos direitos reservados &agrave; <?php echo $this->Config->server['name'] ?><br />
		Powered by <a href="mailto:flavio-hernandes@hotmail.com">Flavio Hernandes</a> - Vers&atilde;o 0.1
	</div>
</body>
</html>